﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using MEC.WMS.FileMaintenance;
using MEC.WMS.FileMaintenance.VendorPTerms;
using MECPSDB.EntityClasses;

namespace MEC.WMS {
    public partial class MainFrm:DevExpress.XtraEditors.XtraForm {
        private readonly string _cs;
        private readonly string _userCode;
        private readonly SystemuserEntity _systemUserEntity;
        private string _branchcode;
        

    public MainFrm(string cs, string userCode, SystemuserEntity systemUserEntity){
            _cs = cs;
            _userCode = userCode;
            _systemUserEntity = systemUserEntity;
            InitializeComponent();
        }

        private void NavBarItemMatGroupLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
            try{
            FileMaintenance.MatGroup.VwFrm vwFrm = new FileMaintenance.MatGroup.VwFrm(_cs, _branchcode, _userCode);
            vwFrm.MdiParent = this;
            vwFrm.Show();
                
            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

        private void NavBarItemmatBrandLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
          try{
            FileMaintenance.MatBrand.VwFrm vwFrm = new FileMaintenance.MatBrand.VwFrm(_cs, _branchcode, _userCode);
            vwFrm.MdiParent = this;
            vwFrm.Show();
                
            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

        private void NavBarItemUoMLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e){
            try{
                FileMaintenance.UoM.VwFrm vwFrm = new FileMaintenance.UoM.VwFrm(_cs, _branchcode, _userCode);
                vwFrm.MdiParent = this;
                vwFrm.Show();

            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

        private void NavBarItemptermLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
          try{
                VwFrm vwFrm = new VwFrm(_cs, _branchcode, _userCode);
                vwFrm.MdiParent = this;
                vwFrm.Show();

            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

        private void NavBarItemmatmasterfileLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
         try{
                FileMaintenance.Material.VwFrm vwFrm = new FileMaintenance.Material.VwFrm(_cs, _branchcode, _userCode);
                vwFrm.MdiParent = this;
                vwFrm.Show();

            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

        private void NavBarItemvendormasterfileLinkClicked(object sender,DevExpress.XtraNavBar.NavBarLinkEventArgs e) {
         try{
                FileMaintenance.Vendor.VwFrm vwFrm = new FileMaintenance.Vendor.VwFrm(_cs, _branchcode, _userCode);
                vwFrm.MdiParent = this;
                vwFrm.Show();

            } catch (Exception ex){
                MessageBox.Show(ex.Message);
            }
        }

      
    }
}